<?php

declare(strict_types=1);

namespace app\admin\controller;

use app\common\model\Hospital;
use app\common\model\Province;
use think\Exception;

/**
 * 默认index
 * Class Index
 * @package app\admin\controller
 */
class Index
{
    /**
     * 默认首页
     * index
     * @return string
     * @throws Exception
     */
    public function index()
    {
        dump(app()->getThinkPath());
        dump(app()->getRootPath());
        dump(app()->getConfigPath());
        dump(app()->getBasePath());
        dump(app()->getNamespace());
        dump(app()->getAppPath());

        dump(\think\facade\App::getAppPath());
        exit;
        abort(404, '页面异常');
        throw new Exception('error');
        return '您好！这是一个[admin]示例应用';
    }

    public function test()
    {
        $sheng = Province::find(1);
        dump($sheng);
        dump($sheng->city);
        $hospital = Hospital::find(1);
        dump($hospital);
        dump($hospital->city);
        dump($hospital->city->province);
        dump($hospital->department1);
        dump($hospital->department1->doctor);
    }
}
